package com.ruoyi.system.mapper.dispatchList;

import com.ruoyi.system.domain.DispatchList;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


@Mapper
public interface DispatchListMapper{

    List<DispatchList> selectList(@Param("dispatchList") DispatchList dispatchList);

    Integer updateById(@Param("dispatchList")DispatchList dispatchList);

    @Select("SELECT \n" +
            "    id AS id,\n" +
            "    dispatch_order_id AS dispatchOrderId,\n" +
            "    origin_order_json AS originOrderJson,\n" +
            "    process_status AS processStatus,\n" +
            "    user_id AS userId,\n" +
            "    nick_name AS nickName,\n" +
            "    phone_number AS phoneNumber,\n" +
            "    address AS address,\n" +
            "    message AS message,\n" +
            "    create_time AS createTime,\n" +
            "    update_time AS updateTime\n" +
            "FROM \n" +
            "    dispatch_list WHERE id = #{id}")
    DispatchList selectById(@Param("id")Integer id);

    @Delete("delete from dispatch_list where id = #{id}")
    Integer deleteById(Integer id);
}
